package cn.tedu._05weibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

@Data
public class UserRegDTO {
    //    @NotNull(message = "必须提交用户名")
//    @NotEmpty(message = "用户名不能为空")
//    @NotBlank(message = "用户名不能为空白")
//    @Size(min = 2, max = 12, message = "用户名长度必须在2~12之间")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,7}|[a-zA-Z]{1,14}$", message = "用户名应为1~7个汉字，或最多14个英文字符")
    @ApiModelProperty(value = "用户名", required = true)
    private String username;
    @NotBlank(message = "密码不能为空白")
    @NotEmpty(message = "密码不能为空")
    @NotNull(message = "必须提交密码")
    @Length(min = 6, max = 20, message = "密码长度必须在6~20之间")
    @ApiModelProperty(value = "密码", required = true)
    private String password;
    @NotNull(message = "必须提交昵称")
    @NotEmpty(message = "昵称不能为空")
    @NotBlank(message = "昵称不能为空白")
    @Size(min = 2, max = 6, message = "昵称长度必须在2~6之间")
    @ApiModelProperty(value = "昵称", required = true)
    private String nickname;
}
